home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Word / A-Ad / Acius Tech Note 9 < prev    next >
Text File  |  1987-10-17  |  2KB  |  55 lines

  1. ____________________________________________________________________
  2.  
  3. 4th Dimension Technical Notes
  4.  
  5. #9    Double clicking in a scrollable area
  6.  
  7. Written by Dave Dell'Aquila    August 24, 1987
  8.  
  9. Published    August 26, 1987
  10. ____________________________________________________________________
  11.  
  12. Double clicking in a scrollable area.
  13. ___________________________________________________________
  14.  
  15. Double clicking in a list is a common habbit among Macintosh users.  This example shows how to 
  16. detect two clicks in the same array element, which is not provided for by 4th Dimension.  This will 
  17. only work with scrollable areas.
  18.  
  19. Case of
  20.     :(Before)  `Initialize variables
  21.         vTime:=Current Time
  22.         vSel:=""
  23.         vDelay:=2  `Time in seconds between clicks
  24.         MakeArray  `A Global Procedure that creates the array
  25.     :(During)
  26.         Case of
  27.             :(Event1)  `Misc events, i.e. checking button status,
  28.             :(Event2)  `updating the array
  29.         Else
  30.             If((Current time-vTime<vDelay)&(vSel=List{List}))
  31.                 Alert("A Double Click has been detected.")
  32.             Else
  33.                 vTime:=Current time
  34.                 vSel:=List{List}
  35.             End if
  36.         End case
  37. End case
  38.  
  39. vDelay controls the delay between clicks, and must be adjusted depending on the amount of code 
  40. in the During phase.  Additional conditions may be added to the If statement to filter out any 
  41. unwanted events, such as button presses.  List  is the array that is constructed once in the Before 
  42. phase and as needed in the During phases.
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50. #n:  Technical Note Title    Page #p of x    
  51.  
  52.  
  53.  
  54.